﻿<phone:PhoneApplicationPage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                            xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                            xmlns:eim="clr-namespace:Microsoft.Expression.Interactivity.Media;assembly=Microsoft.Expression.Interactions"
                            x:Class="TaxiPlease.SettingsPage"
                            mc:Ignorable="d"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            SupportedOrientations="Portrait"
                            Orientation="Portrait"
                            shell:SystemTray.IsVisible="True"
                            d:DesignHeight="768"
                            d:DesignWidth="480">
    <phone:PhoneApplicationPage.Resources>
        <Storyboard x:Name="SlideLeftAnimation">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"
                                           Storyboard.TargetName="textBlock">
                <EasingDoubleKeyFrame KeyTime="0"
                                      Value="100" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.5"
                                      Value="0" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"
                                           Storyboard.TargetName="textBlock1">
                <EasingDoubleKeyFrame KeyTime="0"
                                      Value="100" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.5"
                                      Value="0" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"
                                           Storyboard.TargetName="textBlock2">
                <EasingDoubleKeyFrame KeyTime="0"
                                      Value="100" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.5"
                                      Value="0" />
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </phone:PhoneApplicationPage.Resources>
    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn" />
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn" />
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut" />
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut" />
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <StackPanel Orientation="Horizontal">
            <Image Source="Images/taxi.png"
                   Margin="-36 0 0 12" />
            <TextBlock Text="taxi please!"
                       Style="{StaticResource PhoneTextTitle1Style}" />
        </StackPanel>
        <controls:Pivot Grid.Row="1"
                        x:Name="pivot">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="SelectionChanged">
                    <eim:ControlStoryboardAction Storyboard="{StaticResource SlideLeftAnimation}" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
            <controls:PivotItem Header="settings"
                                DataContext="{Binding Options}">
                <ScrollViewer VerticalScrollBarVisibility="Auto"
                              Margin="0 0 0 48">
                    <StackPanel>
                        <TextBlock x:Name="textBlock"
                                   Text="message"
                                   Style="{StaticResource PhoneTextSubtleStyle}"
                                   RenderTransformOrigin="0.5,0.5">
                        	<TextBlock.RenderTransform>
                        		<CompositeTransform />
                        	</TextBlock.RenderTransform>
                        </TextBlock>
                        <toolkit:PhoneTextBox Text="{Binding SmsPattern, Mode=TwoWay, UpdateSourceTrigger=Explicit}"
                                              TextChanged="PhoneTextBox_TextChanged"
                                              Height="160"
                                              TextWrapping="Wrap"
                                              InputScope="Text"
                                              AcceptsReturn="True"
                                              MaxLength="160"
                                              LengthIndicatorThreshold="160"
                                              LengthIndicatorVisible="True"
                                              DisplayedMaxLength="140"
                                              Hint="Use the &lt;address&gt; placehold for automatic address formating." />
                        <TextBlock Text="{Binding RemainingLenght}"
                                   HorizontalAlignment="Right"
                                   Style="{StaticResource PhoneTextTitle3Style}" />
                        <TextBlock Text="taxi number"
                                   x:Name="textBlock1"
                                   Style="{StaticResource PhoneTextSubtleStyle}">                        	
                            <TextBlock.RenderTransform>
                        		<CompositeTransform />
                        	</TextBlock.RenderTransform>
                        </TextBlock>
                        <toolkit:PhoneTextBox Text="{Binding TaxiPhoneNumber, Mode=TwoWay}"
                                              Grid.Row="4"
                                              ActualHintVisibility="Visible"
                                              InputScope="TelephoneNumber" />
                        <HyperlinkButton HorizontalAlignment="Left"
                                         Command="{Binding SearchContactsCommand}"
                                         Style="{StaticResource CallHyperlink}">
                            <StackPanel Orientation="Horizontal">
                                <Image Source="Images/search.png" />
                                <TextBlock Text="search contacts"
                                           Style="{StaticResource PhoneTextLargeStyle}" />
                            </StackPanel>
                        </HyperlinkButton>
                        <CheckBox Content="Use my Location"
                                  FontSize="{StaticResource PhoneFontSizeMedium}"
                                  IsChecked="{Binding IsLocationEnabled, Mode=TwoWay}" />
                    </StackPanel>
                </ScrollViewer>
            </controls:PivotItem>
            <controls:PivotItem Header="about">
                <ScrollViewer VerticalScrollBarVisibility="Auto">
                    <StackPanel>
                        <TextBlock Text="need a taxi?"
                                   x:Name="textBlock2"
                                   Style="{StaticResource PhoneTextTitle2Style}">
                             <TextBlock.RenderTransform>
                        		<CompositeTransform />
                        	</TextBlock.RenderTransform>
                        </TextBlock>
                        <RichTextBox IsReadOnly="True"
                                     BorderThickness="0"
                                     Margin="{StaticResource PhoneVerticalMargin}"
                                     FontSize="{StaticResource PhoneFontSizeMedium}">
                            <Paragraph>
                                <Bold Foreground="{StaticResource BackgroundBrush}">
                                    <Run Text="Taxi please!" />
                                </Bold>
                                <Run Text="is very simple to use" />
                                <Underline>
                                    <Run Text="location" />
                                </Underline>
                                <Run Text="based application." />
                                <LineBreak />
                                <Run Text="It uses your location only to reverse it to street address, so you can send it with one click to your favorite taxi service provider and wait for the taxi to come and get you." />
                                <LineBreak />
                                <Run Text="As simple as that." />
                            </Paragraph>
                            <Paragraph>
                                <LineBreak />
                            </Paragraph>
                            <Paragraph>
                                <Run Text="Visit" />
                                <Hyperlink NavigateUri="http://miroslavov.com"
                                           Foreground="{StaticResource BackgroundBrush}">
                                    <Run Text="taxi please!" />
                                </Hyperlink>
                                <Run Text="web-site for more information." />
                            </Paragraph>
                        </RichTextBox>
                    </StackPanel>
                </ScrollViewer>
            </controls:PivotItem>
            <controls:PivotItem Header="privacy policy">
                <TextBlock FontSize="{StaticResource PhoneFontSizeMedium}"
                           TextWrapping="Wrap"
                           Text="This application uses the location service of your phone only to get your street address. It does not use your location for any other things not described here. You can disable that functionality from the settings pane." />
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>
</phone:PhoneApplicationPage>
